package cn.micai.base.string;

/**
 * 描述：
 * <p>
 *
 * @author: 赵新国
 * @date: 2018/6/11 15:38
 */
public class StringRemoveASCIIMain {

    public static void main(String [] args) {

        String str = "jå∫∆avµa2bl√øog";
        System.out.println("Before removing non ASCII characters:");
        System.out.println(str);
        System.out.println("------------------------------------");
        // Using regular expressions to remove non ascii characters
        str = str.replaceAll("[^\\p{ASCII}]", "");
        System.out.println("After removing non ASCII characters:");
        System.out.println(str);
    }
}
